from flask import  Flask,session,flash,get_flashed_messages

app = Flask(__name__)
app.secret_key = 'dafsdfads'
app.debug = True 

@app.route("/x1",methods=['GET','POST'])
def login():
    session['msg'] = '测试'
    flash("flask闪现1",category='x1')
    flash("flask闪现2",category='x2')

    return "视图1"

@app.route("/x2",methods=['GET','POST'])
def index():
    data = get_flashed_messages(category_filter=['x1'])
    print(data)
    return "视图2"

if __name__=="__main__":
    app.run()